// pages/user/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    user:{},
    collectNumber:0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options);
  },
  onShow(){
    //初始中缓存中拿去数据
    const user =  wx.getStorageSync('user');
    //出书获取收藏的数量
    const collectNumber = wx.getStorageSync('collect').length;
    this.setData({
      user,
      collectNumber
    })
  },
  logoin(){
    wx.navigateTo({
      url: '../auth/index'
    });
  },
  navigatorCollect(){
    wx.navigateTo({
      url: '../collect/index'
    });
  }
})